package com.crp.security;

import org.apache.shiro.subject.Subject;
import org.apache.shiro.subject.SubjectContext;
import org.apache.shiro.web.mgt.DefaultWebSubjectFactory;

/**
 * @author jincongmin
 *
 */
public class StatelessDefaultSubjectFactory extends DefaultWebSubjectFactory {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.apache.shiro.web.mgt.DefaultWebSubjectFactory#createSubject(org.apache
	 * .shiro.subject.SubjectContext)
	 */
	@Override
	public Subject createSubject(SubjectContext context) {
		// 不创建session
		context.setSessionCreationEnabled(false);
		return super.createSubject(context);
	}

}
